<!doctype html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  
  <meta name="generator" content="Hugo 0.98.0" />

  
  <meta name="description" content="走在通往幸福的路上">
  

  
  <link rel="apple-touch-icon" sizes="180x180" href="https://blog.v5u.win/apple-touch-icon.png">

  
  <link rel="icon" type="image/png" sizes="32x32" href="https://blog.v5u.win/favicon-32x32.png">

  
  <link rel="icon" type="image/png" sizes="16x16" href="https://blog.v5u.win/favicon-16x16.png">

  
  <link rel="manifest" href="https://blog.v5u.win/site.webmanifest">

  
  <link rel="mask-icon" href="https://blog.v5u.win/safari-pinned-tab.svg" color="">

  <meta name="msapplication-TileColor" content="">

  <meta name="theme-color" content="">

  
  <link rel="stylesheet" href="https://blog.v5u.win/css/bootstrap.min.css" />

  
  <title>FF的Git使用整理 | 为吾优</title>
  

  <style>
body {
  min-width: 300px;
}

.custom-navbar {
  margin-bottom: 1em;
  height: 60px;
}

.custom-navbar a {
  display: inline-block; 
  padding: 18px 0;
  margin-right: 1em; 
  font-weight: bold; 
}

.custom-navbar a:hover,
.custom-navbar a:focus {
  text-decoration: none; 
}

@media print {
  .custom-navbar {
    display: none;
  }
}

article {
  padding-bottom: 1em;
}

img {
  max-width: 100%;
}


body {
  background-color: #fff;
}



body {
  color: #212529;
}



a {
  color: #007bff;
}



a:hover,
a:focus {
  color: #0056b3;
}



.custom-navbar {
  background-color: #212529;
}



.custom-navbar a {
  color: rgba(255,255,255,.75);
}



.custom-navbar a:hover,
.custom-navbar a:focus {
  color: rgba(255,255,255,1);
}



.container {
  max-width: 800px;
}





</style>
</head>

<body>
  <nav class="custom-navbar">
  <div class="container">
    
    <a href="/">文章</a>
    
    <a href="/tags/">标签</a>
    
    <a href="/about/">关于</a>
    
    <a href="/index.xml">RSS</a>
    
  </div>
</nav>
  
  <div class="container">
    <article>
      <h1>FF的Git使用整理</h1>
<p>创建 Git仓库命令：(进入将要管理的Git文件夹地址下) git init
查看当前Git管理状态 git status
添加Git文件    git add *
提交文件到仓库 git commit  -m &ldquo;加入注释&rdquo;
推送文件到远程仓库     git push origin master
参考文章：<!-- raw HTML omitted -->Git简易使用指南<!-- raw HTML omitted --> <a href="http://www.bootcss.com/p/git-guide/">http://www.bootcss.com/p/git-guide/</a></p>
<h3 id="git-命令行常用命令">git 命令行常用命令</h3>
<table>
<thead>
<tr>
<th style="text-align:left">git 作用</th>
<th style="text-align:center">命令</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">检查更新状态</td>
<td style="text-align:center">git status</td>
</tr>
<tr>
<td style="text-align:left">将文件添加进更新列表</td>
<td style="text-align:center">git add *</td>
</tr>
<tr>
<td style="text-align:left">commit 提交</td>
<td style="text-align:center">git commit * -m &ldquo;add some(not null非空)&rdquo;</td>
</tr>
<tr>
<td style="text-align:left">发布到服务器</td>
<td style="text-align:center">use &ldquo;git push&rdquo; to publish your local commits</td>
</tr>
<tr>
<td style="text-align:left">发布到主线</td>
<td style="text-align:center">git push origin master</td>
</tr>
<tr>
<td style="text-align:left">发布tag release版本</td>
<td style="text-align:center">git tag</td>
</tr>
<tr>
<td style="text-align:left">add tag</td>
<td style="text-align:center">git tag -m &ldquo;first release&rdquo; 0.1.0</td>
</tr>
<tr>
<td style="text-align:left">git push</td>
<td style="text-align:center">git push &ndash;tags</td>
</tr>
<tr>
<td style="text-align:left">delete 远程tag</td>
<td style="text-align:center">git push origin &ndash;delete tag</td>
</tr>
<tr>
<td style="text-align:left">检出远程分支文件</td>
<td style="text-align:center">git checkout -b dev origin/dev</td>
</tr>
<tr>
<td style="text-align:left">公钥加入本地ssh</td>
<td style="text-align:center">ssh-add ~/.ssh/id_rse</td>
</tr>
<tr>
<td style="text-align:left">查看某域是否有ssh公钥，私钥</td>
<td style="text-align:center">ssh -T <a href="mailto:git@git.oschina.net">git@git.oschina.net</a></td>
</tr>
</tbody>
</table>
<p>level 2</p>
<table>
<thead>
<tr>
<th>git 作用</th>
<th>命令</th>
</tr>
</thead>
<tbody>
<tr>
<td>指定分支克隆</td>
<td>git clone -b dev <a href="https://github.com/jinyuyoulong/Go-learn.git">https://github.com/jinyuyoulong/Go-learn.git</a></td>
</tr>
<tr>
<td>查询所有分支</td>
<td>git branch -a</td>
</tr>
<tr>
<td>移除Git对文件的管理</td>
<td>git rm -rf –cached public</td>
</tr>
<tr>
<td>可视化log</td>
<td>git log &ndash;oneline &ndash;graph &ndash;decorate &ndash;all</td>
</tr>
</tbody>
</table>

    </article>
  </div>

  
  
  

  
</body>

</html>